<template>
    <div ref="body">
        <Form :label-width="120" inline>
            <Form-item label="属地区划:">
                <area-linkage :areaCode.sync="queryParam.azaa0001"></area-linkage>
            </Form-item>
            <Form-item label="家庭编号:">
                <Input v-model="queryParam.azdf0001" placeholder="请输入家庭编号" style="width:200px"/>
            </Form-item>
            <Form-item label="低保证号:">
                <Input v-model="queryParam.ssca0014" placeholder="请输入低保证号" style="width:200px"/>
            </Form-item>
            <Form-item label="受理编号:">
                <Input v-model="queryParam.ssca0061" placeholder="请输入受理编号" style="width:200px"/>
            </Form-item>
            <Form-item label="姓名:">
                <Input v-model="queryParam.azcp0003" placeholder="请输入户主姓名" style="width:200px"/>
            </Form-item>
            <Form-item label="身份证号码:">
                <Input v-model="queryParam.azcp0001" placeholder="请输入户主身份证号码" style="width:200px"/>
            </Form-item>
            <Form-item label="批准时间:">
                <DatePicker type="daterange" split-panels v-model="queryParam.ssca0006"
                            placeholder="请选择批准时间" style="width: 200px"  :editable="false"></DatePicker>
            </Form-item>
            <Form-item label="救助对象类别:">
                <Select v-model="queryParam.systemSubType" style="width: 200px">
                    <Option value='1010'> 城市低保户对象</Option>
                    <Option value='1020'> 城市低保边缘家庭</Option>
                    <Option value='1030'> 城市低保户（低保边缘家庭)申请未通过</Option>
                    <Option value='1040'> 城市低保户停保</Option>
                    <Option value='1050'> 城市低保边缘家庭停保</Option>
                    <Option value='2010'> 农村低保户对象</Option>
                    <Option value='2020'> 农村低保边缘家庭</Option>
                    <Option value='2030'> 农村低保户（低保边缘家庭)申请未通过</Option>
                    <Option value='2040'> 农村低保户停保</Option>
                    <Option value='2050'> 农村低保边缘家庭停保</Option>
                    <Option value='20310'> 农村建档立卡保障家庭</Option>
                    <Option value='20320'> 农村建档立卡停保家庭</Option>
                    <Option value='20330'> 农村建档立卡申请未通过</Option>
                    <Option value='10210'> 城市因病致贫保对象</Option>
                    <Option value='10220'> 城市因病致贫保申请未通过</Option>
                    <Option value='10230'> 城市因病致贫保停保</Option>
                    <Option value='20210'> 农村因病致贫保对象</Option>
                    <Option value='20220'> 农村因病致贫保申请未通过</Option>
                    <Option value='20230'> 农村因病致贫保停保</Option>
                    <Option value='10110'> 城市单人保保对象</Option>
                    <Option value='10120'> 城市单人保申请未通过</Option>
                    <Option value='10130'> 城市单人保停保</Option>
                    <Option value='20110'> 农村单人保保对象</Option>
                    <Option value='20120'> 农村单人保申请未通过</Option>
                    <Option value='20130'> 农村单人保停保</Option>
                </Select>
            </Form-item>

            <Form-item label="致贫原因:">
                <c-dict-select v-model="queryParam.ssca0013" dictCode="poorreason"
                               placeholder="请选择致贫原因"/>
            </Form-item>
            <Form-item label="是否后置核对:">
                <c-dict-select v-model="queryParam.ssca0072" dictCode="yesorno"
                               placeholder="请选择是否后置核对"/>
            </Form-item>
            <Row class="button_row">
                  <span style="float: right;margin-right: 8px">
                 <Button type="primary" @click="searchQueryNew">查询</Button>
                 <Button type="primary" class="button_item_left" @click="searchResetNew">重置</Button>
                     </span>
            </Row>
        </Form>
        <div class="table_div">
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <vxe-table-column field="ssca0043" title="属地区划" align="center" width="220" fixed="left"
                                  :formatter="renderAreaName"/>
                <vxe-table-column field="hzname" title="户主姓名" align="center" width="100" fixed="left"/>
                <vxe-table-column field="azcp0003" title="成员姓名" align="center" width="140" fixed="left"/>
                <vxe-table-column field="azcp0001" title="成员证件号码" align="center" width="180" fixed="left"/>
                <vxe-table-column field="ssca0014" title="低保证号" align="center" width="140"/>
                <vxe-table-column field="datastate" title="救助对象类别" align="center" width="160"/>
                <vxe-table-column field="ssca0006" title="批准时间" align="center" width="140" :formatter="renderTime"/>
                <vxe-table-column field="ssca0011" title="银行账号" align="center" width="140"/>
                <vxe-table-column field="ssca0052" title="保障人口数" align="center" width="140"/>
                <vxe-table-column field="azdf0504" title="家庭贫困指数" align="center" width="140"/>
                <vxe-table-column field="ssca0026" title="总保障金额" align="center" width="100"/>
                <vxe-table-column field="ssca0025" title="分类救助上浮金额" align="center" width="140"/>
                <vxe-table-column field="ssca0049" title="家庭月总收入" align="center" width="140"/>
                <vxe-table-column field="ssca0044" title="家庭基础收入" align="center" width="140"/>
                <vxe-table-column field="ssca0045" title="家庭赡抚养费" align="center" width="140"/>
                <vxe-table-column field="ssca0046" title="家庭财产收入" align="center" width="140"/>
                <vxe-table-column field="ssca0047" title="家庭基础支出" align="center" width="140"/>
                <vxe-table-column field="ssca0042" title="保障标准" align="center" width="100"/>
                <vxe-table-column field="ssca0004" title="差额保障金额" align="center" width="140"/>
                <vxe-table-column field="azdf0001" title="家庭编号" align="center" width="180"/>
                <vxe-table-column field="ssca0003" title="申请时间" align="center" width="100" :formatter="renderTime"/>
                <vxe-table-column field="ssca0033" title="变更申请时间" align="center" width="140" :formatter="renderTime"/>
                <vxe-table-column field="ssca0029" title="审批完成时间" align="center" width="140" :formatter="renderTime"/>
                <vxe-table-column field="ssca0061" title="受理编号" align="center" width="140"/>
                <vxe-table-column field="ssca0032" title="数据来源" align="center" width="100" :formatter="renderSsca0032"/>
                <vxe-table-column field="ssca0013_name" title="致贫原因" align="center" width="100"/>
                <vxe-table-column field="bpm_status_name" title="数据状态" align="center" width="100"/>
                <vxe-table-column title="操作" align="center" width="140" fixed="right">
                    <template #default="{row}">
                        <Button type="default" @click="searchDetail(row)">查看详情</Button>
                    </template>
                </vxe-table-column>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>
        <application-modal ref="modal"/>
    </div>
</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import {getAction, postAction} from '@/api/request'
    import applicationModal from '../db_application_history/applicationModal'

    export default {
        name: "uniformQueryList.vue",
        mixins: [CommonMixin],
        components: {applicationModal},
        data() {
            return {
                queryParam: {},
                name: "",
                Loading: false,
                url: {
                    list: "/api/ac/subsistence/ss12001HistoryService/uniformQueryList",
                },
            }
        },
        methods: {
            renderSsca0032(h) {
                if (h.cellValue == '200') {
                    return '历史导入数据';
                } else if (h.cellValue == '300') {
                    return '推送数据';
                } else if (h.cellValue == '100') {
                    return '填报数据';
                }
            },
            searchQueryNew() {
                var time = this.queryParam.ssca0006;
                if (time) {
                    if (time[0]) {
                        this.queryParam.ssca0006_begin = this.DateFormat(time[0], 'YYYY-MM-DD') + " 00:00:00";
                    }else{
                        this.queryParam.ssca0006_begin ="";
                    }
                    if (time[1]) {
                        this.queryParam.ssca0006_end = this.DateFormat(time[1], 'YYYY-MM-DD') + " 23:59:59";
                    }else{
                        this.queryParam.ssca0006_end ="";
                    }
                }
                this.loadData(1);
            },
            searchResetNew() {
                this.queryParam = {};
                this.loadData(1);
            },
            searchDetail(row) {
                row.processinstid = row.ywgl004;
                var width = this.$refs.body.clientWidth;
                this.$refs.modal.edit(row);
                this.$refs.modal.width = width + 40;
                this.$refs.modal.key = this.uuid();
            },
        },
        created() {
            this.findAreaList();
        }

    }
</script>

<style scoped>
    .paging {
        float: right;
        margin-top: 10px;
    }

    /deep/ .ivu-upload-list {
        display: none;
    }

    /deep/ .ivu-table-cell {
        padding-right: 0px;
        padding-left: 0px;
    }

    /deep/ .ivu-form-item {
        margin-bottom: 10px;
    }

    #statistics {
        height: 50px;
        line-height: 50px;
        width: 100%;
        color: red;
        font-size: 16px;
    }

    #statistics span {
        padding-left: 10px;
        padding-right: 10px;
    }

</style>
